const Mock = require('mockjs');
const result = Mock.mock({
    "data|16": [{
        "id|+1": 1,
        name: function () {
            return `前端第 ${this.id} 期`;
        },
        openDate: "@date"
    }]
})
const Class = require('../models/Class');
// 执行批量插入操作并处理 Promise
Class.bulkCreate(result.data)
    .then(() => {
        console.log('数据插入成功');
    })
    .catch((error) => {
        console.error('数据插入失败:', error);
    });
